package com.dw.common.configuration;

import com.dw.common.service.KVService;
import com.dw.common.service.impl.KVServiceImpl;

public class Configuration {
    public static final String ORGANIZATION_ID = "test";
    public static final long LEASE_TTL = 30;
    public static Integer BATCH_SIZE = 100 * 1024 * 1024;
    public static String UUID = java.util.UUID.randomUUID().toString().replace("-", "");
    public static int PORT = 1314;

    static {
        KVService kvService = new KVServiceImpl();
        String batch_size = kvService.get("BATCH_SIZE");
        if (batch_size != null) {
            BATCH_SIZE = Integer.parseInt(batch_size);
        }
        String port = kvService.get("port");
        if (port != null) {
            PORT = Integer.parseInt(port);
        }
    }
}
